}
_updateEntry(secret) {
+ let newEntry, inactiveEntry;
+
if (secret && this._entry !== this._passwordEntry) {
- this._mainBox.replace_child(this._entry, this._passwordEntry);
- this._entry = this._passwordEntry;
- this._inactiveEntry = this._textEntry;
+ newEntry = this._passwordEntry;
+ inactiveEntry = this._textEntry;
} else if (!secret && this._entry !== this._textEntry) {
- this._mainBox.replace_child(this._entry, this._textEntry);
- this._entry = this._textEntry;
- this._inactiveEntry = this._passwordEntry;
+ newEntry = this._textEntry;
+ inactiveEntry = this._passwordEntry;
+ }
+
+ if (newEntry) {
+ this._mainBox.replace_child(this._entry, newEntry);
+ this._entry = newEntry;
+ this._inactiveEntry = inactiveEntry;
}
+
this._capsLockWarningLabel.visible = secret;
}